//
//  ZYCTeachingAttendanceDetailSectionHeaderView.m
//  ZDSC
//
//  Created by ZDTX on 2021/9/3.
//

#import "ZYCTeachingAttendanceDetailSectionHeaderView.h"
@interface ZYCTeachingAttendanceDetailSectionHeaderView ()

@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *line;

@end
@implementation ZYCTeachingAttendanceDetailSectionHeaderView

- (void)setTitleString:(NSString *)titleString{
    _titleString = titleString;
    _titleLabel.text = titleString;
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = HEX_RGB(@"FFFFFF");
        [self addSubview:self.titleLabel];
        [self addSubview:self.bgView];
        [self addSubview:self.line];
        [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.equalTo(self);
            make.height.mas_equalTo(10.0f);
        }];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(15.0f);
            make.top.equalTo(self.bgView.mas_bottom).offset(20.f);
        }];

        [self.line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(15.0f);
            make.right.equalTo(self).offset(-15.0f);
            make.bottom.equalTo(self);
            make.height.mas_equalTo(0.5f);
        }];
    }
    return self;
}


- (UIView *)bgView {
    if (!_bgView) {
        _bgView = [[UIView alloc] init];
        _bgView.backgroundColor = HEX_RGB(@"#F9F9F9");
    }
    return _bgView;
}
- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [UILabel LabelWithFont:kSystemBoldFont(17.0f) titleColor:HEX_RGB(@"#262A28") textAlignment:ZZTextAlignmentLeft];
        _titleLabel.numberOfLines = 0;
    }
    return _titleLabel;
}

- (UILabel *)line {
    if (!_line) {
        _line = [[UILabel alloc] init];
        _line.backgroundColor = HEX_RGB(@"#EAEAEA");
    }
    return _line;
}


@end
